<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>主题选择-办事指南查询</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" href="../../css/mui.min.css">
		<link rel="stylesheet" href="../../css/app01.css">
		<style>
			body{background-color:#fff;overflow:auto;}
			.memberNav{background:#fff;padding:0 0 .6rem 0;width:7.5rem;float:left;box-sizing:border-box;
			height:auto;}
		   .memberNav ul{padding:.07rem 0 0 0;margin:0;float:left;}
		   .memberNav ul li{width:1.87rem;height:1.2rem;float:left;text-align:center;list-style:none;margin-top:.48rem;position:relative;}
		   .memberNav ul li:nth-child(4n):after{width:0;}
		   .memberNav ul li a{display:block;}
		   .memberNav ul li a>.iconfont{width:100%;height:.45rem;float:left;}
		   .memberNav ul li a>.iconfont>img{width:.65rem;height:.65rem;}
		   .memberNav ul li a>.tit_txt{color:#444;font-size:.24rem;width:100%;text-align:center;float:left;margin-top:.1rem;}
		</style>
	</head>
	<body>
		<div class="memberNav">
        	<ul  id="themeUl">
        	</ul>
		</div>
		        		
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/common.js"></script>
		<script src="../../js/app.js"></script>
		<script>
			var userType = "";
			mui.plusReady(function() {
				//获取上一个页面传过来的参数开始
				userType = utils.getUrlParam('userType');
				loadQueryCondition(userType);
			});
			
			
		/**
		 * 加载更多分类
		 * @param {Object} userType 服务对象 个人 或者法人
		 */
		function loadQueryCondition(userType){
			var param = 'userType=' + userType;
				var url = 'appHttpService/appThemeCode.do';
				utils.ajax(url, function(data) {
					data = JSON.parse(data);
					if(data.code == 0){
						var fwztData = JSON.parse(data.fwzt);//服务主题
						var fwztDiv_html="<li id='' nameVal=''><a><span class='iconfont'><img src='../../images/theme/qb.png'></span><span class='tit_txt'>全部主题</span></a></li>";
						for(var i in fwztData) {
							var src = "../../images/work/theme02.png";
							if(fwztData[i].code  != null && fwztData[i].code != '' && fwztData[i].code != undefined){
								if(userType == 0){
									src = "../../images/theme/gr/"+fwztData[i].code+".png";
								}
								if(userType == 1){
									src = "../../images/theme/fr/"+fwztData[i].code+".png";
								}
							}
							fwztDiv_html+="<li id="+fwztData[i].oid+" nameVal="+fwztData[i].name+"><a><span class='iconfont'><img src="+src+"></span><span class='tit_txt'>"+fwztData[i].name+"</span></a></li>";
						}
						document.getElementById("themeUl").innerHTML = fwztDiv_html;
						
						//关闭进度条
						closeWaitingAndShowView();
						//绑定事件
						mui('#themeUl').on('tap','li',function(){
							var id = this.getAttribute("id");
							var name = this.getAttribute("nameVal");
							var workView = plus.webview.getWebviewById("tab-webview-subpage-work.html");
							mui.fire(workView,"updateTheme",{"id":id,"name":name});
							mui.back();
						});
					}else{
						closeWaitingAndShowView();
						mui.toast("查询失败！请联系管理员");
					}
				}, param);
		}
		
		</script>
	</body>
</html>
